<template>
  <view class="container">
    <view class="header_txt">
      <view class="back"
            @click="backHandler">
        <image src="/static/img/back3.png"></image>
      </view>
      <view class="title"> 我的课程 </view>
    </view>
    <view class="content">
      <view class="none_msg"
            v-if="InfoList.length == 0">
        <image src="../../static/image/offerxq_img_k@2x.png"
               mode=""></image>
        <view class="none_title">暂无信息</view>
      </view>

      <scroll-view class="list_box_all"
                   :scroll-y="true"
                   lower-threshold="50"
                   @scrolltolower="lowerY">
        <view class="list_box">
          <view class="list_item"
                v-for="(item,index) in InfoList"
                :key="index"
                @click="goDet(item.c_id)">
            <view class="list_left">
              <image :src="$serverIPimg+item.curriculum.image"
                     mode=""></image>
            </view>
            <view class="list_right">
              <view class="list_right_title">{{item.curriculum.name}}</view>
              <view class="list_tip">{{item.all_num}}套真题|讲义</view>
            </view>
          </view>
        </view>
      </scroll-view>
    </view>
  </view>
</template>

<script>
export default {
  data() {
    return { InfoList: [] }
  },
  onLoad() {
    this.getMyCurriculum()
  },
  methods: {
    backHandler() {
      uni.navigateBack({
        delta: 1
      })
    },
    //Curriculum/my_curriculum
    async getMyCurriculum() { 
      const { data } = await this.$http.post('/Curriculum/my_curriculum', { page: 1, pageSize: 10 })
      console.log(data)
      this.InfoList = data.data.data 
    }
  }  
}
</script>

<style lang="scss">
/* 头部区域 */
.header_txt {
  width: 750rpx;
  overflow: hidden;
  height: 88rpx;
  line-height: 88rpx;
  background-color: #fff;

  .back {
    position: absolute;
    top: 14rpx;
    left: 14rpx;
    width: 60rpx;
    height: 60rpx;
    display: flex;
    justify-content: center;
    align-items: center;
    image {
      width: 48rpx;
      height: 48rpx;
    }
  }

  .right {
    position: absolute;
    top: 14rpx;
    right: 14rpx;
    width: 60rpx;
    height: 60rpx;
    display: flex;
    justify-content: center;
    align-items: center;
  }

  .title {
    text-align: center;
    height: 88rpx;
    // margin-top: -20rpx;
    // line-height: 88rpx;
    font-size: 32rpx;
    font-weight: bold;
  }
}

.content {
  width: 100%;
  height: 100%;
  /* overflow-y: auto; */
}
.list_box_all {
  width: 100%;
  height: 100%;
}
.list_box {
  width: 100%;
  height: auto;
  background-color: #ffffff;
  padding: 0 30rpx;
  margin-top: 20rpx;
}
.list_item {
  width: 100%;
  height: 190rpx;
  display: flex;
  justify-content: flex-start;
  align-items: center;
}
.list_left image {
  width: 196rpx;
  height: 130rpx;
  border-radius: 10rpx;
}
.list_right {
  width: 68%;
  height: 100%;
  margin-left: 20rpx;
  padding-top: 30rpx;
  border-bottom: 1rpx solid #f5f5f5;
}
.list_right_title {
  font-size: 28rpx;
  font-family: PingFang SC;
  font-weight: bold;
  color: #333333;
}
.list_tip {
  font-size: 20rpx;
  font-family: PingFang SC;
  font-weight: 500;
  color: #999999;
  margin-top: 10rpx;
}
/* 暂无消息 */
.none_msg {
  width: 100%;
  height: auto;
  display: flex;
  justify-content: center;
  align-items: center;
  flex-direction: column;
  margin-top: 300rpx;
}

.none_msg image {
  width: 354rpx;
  height: 253rpx;
}

.none_title {
  font-size: 26rpx;
  font-family: PingFang SC;
  font-weight: 500;
  color: #666666;
  margin-top: 40rpx;
}
</style>